<template>
	<view class="add">
		<view class="title m02">
			附近可连接设备
		</view>
		<view class="printer bf m02 pt10">
			<view class="row m2302 " v-for="(item) in list" :key="item.deviceId">
				<view class="col">
					<view class="name block">{{item.name}}</view>
					<view class="deviceId block">{{item.deviceId}}</view>
				</view>
				<view class="col">
					<view class="fr link"
					:data-title="item.deviceId"
					:data-name="item.name"
					:data-advertisData="item.advertisServiceUUIDs"
					@tap="bindViewTap">
					连接
					</view>
					
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import utils from '@/common/utils.js';
	export default {
		name: 'my-print-set',
		components: {},
		data() {
			return {
				// list:[]
			}
		},
		computed: {
			list() {
				return this.BLE_list
			}
		},
		async onLoad(options) {
			this.util.setNT('蓝牙打印机');
			await this.startSearch()
			// this.list = [ {
			// 	"deviceId": "78:02:B7:85:07:8B",
			// 	"name": "TicWatch GTX-078B",
			// 	"RSSI": -96,
			// 	"localName": "TicWatch GTX-078B",
			// 	"advertisServiceUUIDs": ["00005533-0000-1000-8000-00805F9B34FB",
			// 		"00002222-0000-1000-8000-00805F9B34FB",
			// 		"0000FEE7-0000-1000-8000-00805F9B34FB"
			// 	],
			// 	"advertisData": {}
			// }, {
			// 	"deviceId": "48:D8:90:BF:7B:98",
			// 	"name": "RTK_BT_4.1",
			// 	"RSSI": -101,
			// 	"localName": "RTK_BT_4.1\u0000",
			// 	"advertisServiceUUIDs": ["0000FE3C-0000-1000-8000-00805F9B34FB"],
			// 	"advertisData": {}
			// }, {
			// 	"deviceId": "DC:0D:30:9C:C3:7B",
			// 	"name": "Printer001",
			// 	"RSSI": -59,
			// 	"localName": "Printer001",
			// 	"advertisServiceUUIDs": [],
			// 	"advertisData": {}
			// }]

		},
	}
</script>

<style scoped>
	.title {
		margin-bottom: 10rpx;
	}

	.link {
		border: 2rpx solid #ddd;
		border-radius: 58rpx;
		line-height: 58rpx;
		text-align: center;
		color: #000;
		width: 140rpx;
		height: 58rpx;
		font-size: 24rpx;
		transform: translateY(10rpx);
	}
</style>
